﻿using Abp.Application.Navigation;
using Abp.Localization;
using Partner.Surround.Authorization;

namespace Partner.Surround.Web.Startup
{
    /// <summary>
    /// This class defines menus for the application.
    /// </summary>
    public class SurroundNavigationProvider : NavigationProvider
    {
        public override void SetNavigation(INavigationProviderContext context)
        {
            context.Manager.MainMenu
                .AddItem(
                    new MenuItemDefinition(
                        PageNames.CoreManage,
                        L(PageNames.CoreManage),
                        icon: "&#xe828;",
                        requiredPermissionName: PermissionNames.Pages_Core
                    ).AddItem(
                        new MenuItemDefinition(
                            PageNames.DataDictionary,
                            L("DataDictionary"),
                            url: "/Core/DataDictionary",
                            icon: "&#xe6cb;",
                            requiredPermissionName: PermissionNames.Pages_Core_DataDictionary
                        )
                    )
                );
        }

        private static ILocalizableString L(string name)
        {
            return new LocalizableString(name, SurroundConsts.LocalizationSourceName);
        }
    }
}
